define(function () {
    let modelNormal = function () {
        this.pareNode = document.querySelector(".model-normal")
        this.fadeModel = document.querySelector(".model-normal-wrapper")
    }

    modelNormal.whetherShow = function (flag) {
        if (flag) {
            this.fadeModel.style.display = "block"
            this.pareNode.style.top = "50%"
        } else {
            this.fadeModel.style.display = "none"
            this.pareNode.style.top = "-150%"
            this.pareNode.querySelector(".textarea-share").value = ""
        }
    }
    
    modelNormal.setText = function (typeText, reasonText) {
        this.pareNode.querySelectorAll(".model-map span")[1].innerText = " " + typeText
        this.pareNode.querySelector(".textarea-share").setAttribute("placeholder", reasonText)
    }
    
    modelNormal.setShow = function (kindString) {
        let that = this
        that.pareNode.querySelector(".model-close").onclick = function () {
            that.whetherShow(false)
        }
        that.pareNode.querySelector(".cancel-open").onclick = function () {
            that.whetherShow(false)
        }
        that.pareNode.querySelector(".shareAdd-sure-send").onclick = function () {
            let text = that.pareNode.querySelector(".textarea-share").value
            if (text === "") {
                layer.msg('内容为空', {time: 800})
            }
        }
    }

    modelNormal.setDisplay = function (kindString) {
        this.whetherShow(true)
        this.setShow(kindString)
    }
    return modelNormal
})